<%--
  Created by IntelliJ IDEA.
  User: taohj
  Date: 2014/6/29
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<c:set var="dashboardMenuTag" value="myorg" scope="request"></c:set>
<c:set var="menu" value="none" scope="request"></c:set>

<!Doctype html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>政府数据开放平台</title>
    <jsp:include page="../../../commons/include.jsp"/>

    <script>
        $(document).ready(function () {
            $("input[action=add]").on('click', function () {
                var org = $("form input[type=hidden][name=org]").val();
                var users=new Array();

                $("input[name='ck']:checked").each(function(index){
                      users[index]=$(this).attr("member");
                });

                $.post("/front/my/org/member/create",{org:org,'users[]':users},function(data){
                    if(data.success){
                        location.href="http://localhost/front/my/org/member/list?org="+org;
                    }
                },'json');


            })


        });
    </script>
</head>
<body>


<jsp:include page="../../../commons/top.jsp"/>

<div class="main" style="min-height: 600px">
    <jsp:include page="../../../commons/dashboardMenu.jsp"/>


    <div>
        <div class="left">
            <c:set var="leftMenu" value="member" scope="request"></c:set>
            <jsp:include page="../commons/leftMenu.jsp"/>
        </div>
        <div class="right">
            <div>
                <div style="width: 100%;padding: 20px 0px 20px 20px; float: left;">


                    <div>
                        <form action="/front/my/org/member/addV">
                            <input type="hidden" name="org" value="${requestScope.org}">
                            <table>
                                <tr>
                                    <td>用户名：</td>
                                    <td><input type="text" name="username"></td>
                                    <td width="10"></td>

                                    <td>性别：</td>
                                    <td>
                                        <select dataSync='true' syncType='dictionary' dictionaryType="USER_SEX">
                                            <option value="">请选择</option>
                                        </select>
                                    </td>
                                    <td width="20"></td>
                                    <td><input type="submit" value="搜  索"></td>
                                </tr>
                            </table>
                        </form>
                    </div>


                    <div style="padding: 30px;">
                        <div style="min-height: 460px">
                            <table class="table" width="100%">
                                <thead>
                                <tr>
                                    <td width="50"></td>
                                    <td width="50">序号</td>
                                    <td>用户名</td>
                                    <td>姓名</td>
                                    <td>性别</td>
                                    <td>图片</td>
                                    <td>手机</td>
                                    <td>邮箱</td>

                                </tr>
                                </thead>

                                <tbody>
                                <c:forEach items="${requestScope.result.pageResult.rows}" var="member" varStatus="status">
                                    <tr member="${member.id}">
                                        <td><input name="ck" member="${member.id}" type="checkbox" ></td>
                                        <td>${status.count}</td>
                                        <td>${member.username}</td>
                                        <td>${member.realname}</td>
                                        <td>${member.sex.name}</td>

                                        <td><img src="${member.headImage}" width="30" height="30"></td>
                                        <td>${member.telephone}</td>
                                        <td>${member.email}</td>

                                    </tr>

                                </c:forEach>

                                <tr>
                                    <td colspan="8">

                                    </td>
                                </tr>
                                </tbody>
                            </table>

                        </div>


                    </div>


                </div>

                <div>
                    <ul class="pagination" style="margin: 20px 30px;">
                        <li page="${requestScope.result.pageResult.startPage-1}">&laquo;</li>

                        <c:forEach begin="${requestScope.result.pageResult.startPage}"
                                   end="${requestScope.result.pageResult.endPage}" var="index">
                            <li page="${index}" <c:if
                                    test="${index==requestScope.result.pageResult.page}"> class="active" </c:if> >${index}
                            </li>
                        </c:forEach>

                        <li page="${requestScope.result.pageResult.endPage+1}">&raquo;</li>
                    </ul>
                </div>
            </div>


            <div style="text-align: right;padding-right: 50px;"> <input type="button" action="add" value="添加"></div>

        </div>
    </div>


</div>





<jsp:include page="../../../commons/buttom.jsp"/>
</body>
</html>
